<?php

namespace App\Http\Requests;

/**
 * 系统菜单-表单请求类
 * @package App\Http\Requests
 */
class AdminSysMenuPost extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'group_id' => 'required',
            'menu_name' => 'required',
            'perm_id' => 'required',
            'icon_class' => 'required',
            'order_num' => 'integer|min:0',
        ];
    }
    public function messages()
    {
        return [
            'group_id.required' => '请选择菜单所属分组',
            'menu_name.required' => '请输入菜单名',
            'perm_id.required' => '请选择菜单绑定权限',
            'icon_class.required' => '请选择菜单图标',
            'order_num.min' => '排序数值必须大于0',
        ];
    }
}
